import axios from 'axios';

export const bingSearch = async (query) => {
  try {
    const response = await axios.post('http://localhost:3000/api/bing-web', {
      q: query
    }, {
      headers: {
        'Content-Type': 'application/json'
      }
    });
    return response.data;
  } catch (error) {
    console.error('Bing搜索失败:', error);
    throw new Error('搜索服务暂时不可用');
  }
};